package com.manager;


import java.io.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import control.database.DataBase;

public class Test {
 public String getMM(String username,String domainName){
	 DataBase db= new DataBase();
	 ResultSet rst=null;
	 String s="";
	 String sql="select pwd,ppwd from users where username='"+username+"'"+" and domainName='"+domainName+"'";
	 rst=db.executeQuery(sql);
	 try {
		if(rst.next())
		 {
		s="return=0;password="+rst.getString("pwd")+";mobile_ppwd="+rst.getString("ppwd")+";";
		 return s;
		 }
		else {
			
			return "return=1;";
		}
	} catch (SQLException e) {
		 return "return=2;";
	}
 }
	public static void main(String[] args) {
		// DataBase db= new DataBase();
		 //ResultSet rst=null;
		 
		FileWriter output;
		
		try {
			output = new FileWriter("D://upload/code.txt");
			BufferedWriter bw = new BufferedWriter(output);
			bw.write("s");
			bw.newLine();
			bw.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}



	}
}
